<template>
  <div class="products">
     <Slideshow></Slideshow>
     <div class="content">
         <div class="product-display">
            <div class="header">
              <h3>产品展示</h3>
              <span></span>
            </div>
            <div class="list">
              <ul>
                <li v-for="(productLists, index) in productList" :key="index" @mouseover="wordsColor(index)" @mouseout="wordsColor_1(index)">
                  <router-link :to="{name:'ProductDetails',params:{id:productLists.id}}"><img :src="productLists.cover" alt="产品图片"></router-link>
                  <h4>
                    <router-link :to="{name:'ProductDetails',params:{id:productLists.id}}" class="title">{{productLists.title}}</router-link>
                  </h4>
                  <span></span>
                </li>
              </ul>
            </div>
         </div>
    </div> 
     <Footer></Footer>
     <Fixeds></Fixeds>
     <Dialog></Dialog>
      
  </div>
</template>
<script>
import Slideshow from '../../common/Slideshow'
import Footer from "../../common/Footer"
import Fixeds from "../../common/Fixeds"
import Dialog from "../../common/Dialog"

export default {
  name: 'Product',
  data(){
    return{
      productList: []
    }
  },
  components: {
    Slideshow,
    Footer,
    Fixeds,
    Dialog
  },
  created () {
      var node = this;
      window.$.get(this.apiUrl + '/articles/index',{
          per_page: 10,
          page:1,
          category:4
      }, function (res) {
          node.productList = res.data;
      })
  },
  methods: {
    wordsColor(index){
      let words = document.getElementsByClassName("title")[index];
      words.style.color = '#009ae9';
    },
    wordsColor_1(index){
       let words = document.getElementsByClassName("title")[index];
       words.style.color = '#000';
    }
  },
  beforeDestroy () {
    console.log('销毁了')
  }
}
</script>
<style scoped>
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
button,
textarea,
p,
blockquote,
th,
td {
  overflow: hidden;
}
.products{
   width: 100%;
   height: auto; 
 }
 .products .content{
  width: 1280px;
  height: auto;
  margin: 50px auto 100px;
}
.products .content .product-display .header{
  width: 1280px;
  height: 54px;
}
.products .content .product-display .header h3{
  width: 100%;
  height: 38px;
  font-size: 36px;
  color: #110567;
  line-height: 38px;
}
.products .content .product-display .header span{
  display: inline-block;
  width: 151px;
  border-top: 3px solid #009ae9;
  margin-top: 7px;
}
.products .content .product-display .list{
  width: 1203px;
  height: auto;
  margin-top: 40px;
  /* position: relative; */
}
.products .content .product-display .list ul li{
  width: 309px;
  height: 354px;
  float: left;
  margin-left: 130px;
  margin-top: 80px;
}
.products .content .product-display .list ul li:nth-child(1),.products .content .product-display .list ul li:nth-child(4),.products .content .product-display .list ul li:nth-child(7),
.products .content .product-display .list ul li:nth-child(10),.products .content .product-display .list ul li:nth-child(13),.products .content .product-display .list ul li:nth-child(16)
{
  margin-left: 0;
}
.products .content .product-display .list ul li:nth-child(1),.products .content .product-display .list ul li:nth-child(2),.products .content .product-display .list ul li:nth-child(3){
  margin-top: 0;
}
.products .content .product-display .list ul li a{
  width: 300px;
  height: 300px;
  display: inline-block;
}
.products .content .product-display .list ul li img{
  width: 300px;
  height: 300px;
}
.products .content .product-display .list ul li h4{
  width: 100%;
  height: auto;
  color: #000;
  font-size: 24px;
  text-align: center;
  margin-top: 10px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.products .content .product-display .list ul li h4 a{
  width: 100%;
  height: 35px;
  color: #000;
  font-size: 24px;
  text-decoration: none;
}
.products .content .product-display .list ul li:nth-child(1) span{
  width: 1200px;
  display: inline-block;
  border-bottom: 1px solid #E8E8E8;
  position: absolute;
  top: 851px; 
}
.products .content .product-video{
  width: 1280px;
  height: auto;
  margin-top: 100px;
}
.products .content .product-video .video{
  width: 1280px;
  height: auto;
  margin-top: 46px;
}
.products .content .product-video video{
  width: 100%;
  height: auto;
  float: left;
}
</style>

  


